package com.aier.admin.service;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

import com.aier.admin.entity.BuZou;
import com.aier.admin.entity.CaiPu;
import com.aier.admin.entity.CaiXi;
import com.aier.admin.entity.GongYi;
import com.aier.admin.entity.KouWei;
import com.aier.admin.entity.NanDu;
import com.aier.admin.entity.ZhuLiao;
import com.aier.user.entity.userapp.Advert;
import com.aier.user.entity.userapp.CaiPuComment;

public interface IAdminCaiPuService {

    
     /**
    * 根据菜谱时间排序
    */
    int CAIPU_SORTABLE_TIME=1;
   
   /**
    * 根据菜谱时间倒排序
    */
    int CAIPU_SORTABLE_TIME_DESC=2;
   
   /**
    * 菜谱列表显示条数
    */
    int CAIPU_LIST_PAGESIZE=10;
   
    /**
     * 添加菜谱
     * @param cp_name
     * @param cp_desc
     * @param cp_time
     * @param cp_ptime
     * @param cp_number
     * @param cx_id
     * @param nd_id
     * @param gy_id
     * @param kw_id
     * @param cp_img
     * @param zhuliaos
     * @param fuliaos
     * @param buzous
     * @return
     */
    int insertCaipu(String cp_name,String cp_desc,String cp_time,String cp_ptime,String cp_number,long cx_id,long nd_id,long gy_id,
            long kw_id,String cp_img,String zhuliaos,String fuliaos,String buzous);
    
    /**
     * 根据条件分页查询菜谱信息
     * @param page
     * @param pagesize
     * @param sortable
     * @param cp_name
     * @param cp_time
     * @param cx_id
     * @param nd_id
     * @param gy_id
     * @param kw_id
     * @param zl_ids
     * @return
     */
    Map<String, Object> searchCaiPuListByCondition(int page,
            int pagesize, int sortable, String cp_name, String cp_time,
            long cx_id,long nd_id,long gy_id,long kw_id,List<Long> zl_ids);

    /**
     * 查询工艺列表
     * @return
     */
    List<GongYi> searchGongYiList();

    Map<String, Object> searchGongYiList(int page, int pagesize);
    
    /**
     * 查询口味列表
     * @return
     */
    List<KouWei> searchKouWeiList();
    
    Map<String, Object> searchKouWeiList(int page, int pagesize);

    /**
     * 查询难度列表
     * @return
     */
    List<NanDu> searchNanDuList();
    
    Map<String, Object> searchNanDuList(int page, int pagesize);

    /**
     * 查询菜系列表
     * @return
     */
    List<CaiXi> searchCaiXiList();
    
    Map<String, Object> searchCaiXiList(int page, int pagesize);
    
    /**
     * 查询主料
     * @param page
     * @param caipuListPagesize
     * @return
     */
    Map<String, Object> searchZhuLiaoList(int page, int pagesize);

    /**
     * 删除菜谱
     * @param cp_id_del
     * @return
     */
    int deleteCaiPu(long cp_id_del);

    /**
     * 根据菜谱id查询菜谱
     * @param cp_id_del
     * @return
     */
    CaiPu searchCaiPuById(long cp_id_del);
    CaiPu searchCaiPuById_APP(long cp_id);
    
    /**
     * 根据菜谱id查询菜谱的步奏列表
     * @param cp_id
     * @return
     */
    List<BuZou> searchBuZouListByCpid(long cp_id);

    /**
     * 修改菜谱
     * @param cp_id_del
     * @param cp_name
     * @param cp_desc
     * @param cp_time
     * @param cp_ptime
     * @param cp_number
     * @param cx_id
     * @param nd_id
     * @param gy_id
     * @param kw_id
     * @param cp_img
     * @param zhuliaos
     * @param fuliaos
     * @param buzous
     * @return
     */
    int updateCaipu(long cp_id_del, String cp_name, String cp_desc,
            String cp_time,String cp_ptime,String cp_number, long cx_id, long nd_id, long gy_id, long kw_id,
            String cp_img, String zhuliaos, String fuliaos, String buzous);

    /**
     * 根据工艺名称查询工艺
     * @param gy_name_add
     * @return
     */
    GongYi searchGongYiByName(String gy_name_add);

    /**
     * 根据难度名称查询难度
     * @param nd_name_add
     * @return
     */
    NanDu searchNanDuByName(String nd_name_add);
    
    /**
     * 根据菜系名称查询菜系
     * @param cx_name_add
     * @return
     */
    CaiXi searchCaiXiByName(String cx_name_add);
    
    /**
     * 根据口味名称查询口味
     * @param gy_name_add
     * @return
     */
    KouWei searchKouWeiByName(String kw_name_add);

    /**
     * 添加工艺
     * @param gy_name_add
     * @return
     */
    int insertGongYi(String gy_name_add);
    
    /**
     * 添加难度
     * @param nd_name_add
     * @return
     */
    int insertNanDu(String nd_name_add);
    
    /**
     * 添加菜系
     * @param cx_name_add
     * @return
     */
    int insertCaiXi(String cx_name_add);
    
    /**
     * 添加口味
     * @param kw_name_add
     * @return
     */
    int insertKouWei(String kw_name_add);

    /**
     * 删除工艺
     * @param gy_id_del
     * @return
     */
    int deleteGongYi(long gy_id_del);

    /**
     * 删除难度
     * @param nd_id_del
     * @return
     */
    int deleteNanDu(long nd_id_del);

    /**
     * 删除菜系
     * @param cx_id_del
     * @return
     */
    int deleteCaiXi(long cx_id_del);

    /**
     * 删除口味
     * @param kw_id_del
     * @return
     */
    int deleteKouWei(long kw_id_del);

    /**
     * 修改主料图片
     * @param zl_id
     * @param zl_img
     * @return
     */
    int updateZhuLiao(long zl_id, String zl_img);

    /**
     * 查询主料
     * @param zl_id
     * @return
     */
    ZhuLiao searchZhuLiaoById(long zl_id);

    /**
     * 根据版块id查询菜谱列表
     * @param cx_id
     * @return
     */
    List<CaiPu> searchCaiPuListByCxid(long cx_id);
    Map<String,Object> searchCaiPuListByCxid(int page,int pagesize,long cx_id);

    /**
     * 获取收藏夹中的菜谱列表
     * @param uid
     * @param mid
     * @return
     */
    List<CaiPu> searchFavoriteCaiPuList(Long uid, long mid);
    Map<String,Object> searchFavoriteCaiPuList(int page,int pagesize,Long uid, long mid);
    
    /**
     * 增加菜谱到菜谱收藏夹
     * @param uid
     * @param mid
     * @param cp_id
     * @param ageInfo
     * @return
     */
    int insertFavoriteCaiPu(Long uid, long mid, long cp_id, String ageInfo);

    /**
     * 删除收藏夹中的菜谱列表
     * @param uf_id
     * @return
     */
    int deleteFavoriteCaiPu(long uf_id);

    /**
     * 查询菜谱评论列表
     * @param cp_id
     * @return
     */
    List<CaiPuComment> searchCaiPuCommentList(long cp_id);
    Map<String,Object> searchCaiPuCommentList(int page,int pagesize,long cp_id);

    /**
     * 增加菜谱评论
     * @param uid
     * @param cp_id
     * @param comment
     * @param cdate
     * @return
     */
    int insertCaiPuComment(Long uid, long cp_id, String comment,
            Timestamp cdate);

    
    List<String> searchTest();

    /**
     * 修改主料图片
     * @param zl_name
     * @param zl_img
     * @return
     */
    int updateZhuLiao(String zl_name, String zl_img);

    /**
     * 获取工艺，难度，口味id(没有就新增)
     * @param string
     * @param nd_name
     * @return
     */
    long updateCaipu_tmpinfo(String string, String nd_name);

    /**
     * 查询用户app广告列表
     * @return
     */
    List<Advert> searchAdvertList();
    
    
}
